﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoolCode.Web.Mvc.UI.Grid.Toolbar;

namespace CoolCode.Web.Mvc 
{
    public static  class ToolbarExtensions
    {  
        public static IToolbarContainer DefaultConfig(this IToolbarContainer container)
        {
            return container.New().Delete().Refresh();
        }

        public static IToolbarContainer New(this IToolbarContainer container)
        {
           return  container.Add(b => b.Named("新增").Css("add"));//.OnClick(() => "$add();"));
        }

        public static IToolbarContainer Edit(this IToolbarContainer container)
        {
           return  container.Add(b => b.Named("编辑").Css("edit"));//.OnClick(() => "$edit();"));          
        }

        public static IToolbarContainer Delete(this IToolbarContainer container)
        {
           return  container .Add(b => b.Named("删除").Css("delete"));//.OnClick(() => "$delete();"));
        }

        public static IToolbarContainer Refresh(this IToolbarContainer container)
        {
            return container.Add(b => b.Named("刷新").Css("refresh"));//.OnClick(() => "$refreshGrid();"));
        }

    }
}
